package cn.jinjimi.app.entity;

import cn.jinjimi.app.bean.Constants;
import cn.jinjimi.app.main.CateTabPresenter;
import cn.jinjimi.app.main.fragment.CateTabFragment;
import cn.jinjimi.app.main.fragment.HomeFragment;
import cn.jinjimi.app.main.fragment.CertFragment;
import cn.jinjimi.app.main.fragment.MainWebViewFragment;
import cn.jinjimi.app.main.fragment.MeFragment;

/**
 * @author zhenhua
 */

public enum MainTab {

    /* 首页 */
    MAIN("tab_home", 0, HomeFragment.class, Constants.Route.HOME_URL),
    /* 分类 */
    CATE("tab_cate", 1, CateTabFragment.class, Constants.Route.CATE_URL),
    /* 会员 */
    VIP("tab_vip", 2, MainWebViewFragment.class, Constants.Route.VIP_URL),
    /* 购物车 */
    CERT("tab_cert", 3, CertFragment.class, Constants.Route.CERT_URL),
    /* 我的 */
    ME("tab_me", 4, MeFragment.class, Constants.Route.ME_URL);

    private final String url;
    private String code;
    private int position;
    private Class<?> className;

    MainTab(String code, int position, Class<?> className, String url) {
        this.code = code;
        this.position = position;
        this.className = className;
        this.url = url;
    }

    public Class<?> getClz() {
        return this.className;
    }

    public String getCode() {
        return this.code;
    }

    public int getPosition() {
        return this.position;
    }

    public String getUrl() {
        return url;
    }
}
